<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="0" />
<meta name="acc" content="_build"/>
<title>单位资质</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中 -->
<%-- ui tabs --%>

<script type="text/javascript"
	src="<c:url value='/ext/ui/jquery-ui-1.8.12.custom.min.js'/>"></script>
<link href="${ctx}/styles/lightness/jquery-ui-1.8.12.custom.css"
	rel="stylesheet" />
<script>
	$(document).ready(function() {
		$("#certificateDate").addClass("Wate").bind("focus", function() {
			WdatePicker({
				skin : 'whyGreen',
				maxDate : '%y-%M-%d',
				dateFmt : 'yyyy-MM-dd'
			});
		});
		$("#inputForm").validate({
			rules:{
				certificateDate:{
					required:true,
				},
				grade:{
					required:true,
				},
				code:{
					required:true,
					remote:"qualification!checkCode.action?oldCode=${code}"
				},
				certificate:{
					required:true,
				}
			},
			messages:{
				certificateDate:{
					required:"请选择发证时间！",
				},
				code:{
					required:"请输入证书编号!",
					remote:"证书编号已经使用！"
				},
				certificate:{
					required:"请输入发证机关！",
				},
				grade:{
					required:"请输入证书等级！",
				}
			}
		});
	});
	
	
</script>
</head>
<body>
<form action="qualification!save.action" method="post" id="inputForm"
	class='yform' enctype="multipart/form-data">
<div id="caption">
<h6>单位资质</h6>
</div>
<table width="200" class="noborder">
	<tr>
		<td>所属单位：</td>
		<td><c:if test="${id!=null }">
			<input name="hg" type="text" value="${organization.orgName}"
				readonly="readonly" />
		</c:if> <c:if test="${id==null}">
			<input name="gh" type="text" value="${organizations.orgName}"
				readonly="readonly" />
		</c:if> <input type="hidden" name="id" value="${id}" /> <input type="hidden"
			name="organizationId" value="${organizationId}" /> <input
			type="hidden" name="projectId" value="${projectId}" /> <input
			type="hidden" name="typeId" value="${typeId}" /> <input
			type="hidden" name="deptId" value="${deptId}" /></td>
		<td>证书等级：</td>
		<td><input name="grade" type="text" value="${grade}" /></td>
	</tr>
	<tr>
		<td>证书编号：</td>
		<td><input name="code" type="text" value="${code}" /></td>
		<td>发证机关：</td>
		<td><input name="certificate" type="text" value="${certificate }" /></td>
	</tr>
	<tr>
		<td>发证日期：</td>
		<td ><input id="certificateDate" name="certificateDate"
			readonly="readonly" type="text"
			value="<fmt:formatDate value="${certificateDate}" pattern="yyyy-MM-dd" />" /></td>
	</tr>
	<tr>
		<td>附件：</td>
		<td colspan="3" ><input name="attachmention.upfile" type="file" />
		</td>
	</tr>
	<c:if test="${not empty attachment.id}">
				<tr id="attachment">
				<td>已有附件</td>
				<td colspan="3">
				<a title="下载"
					href="${ctx}/servlet/annex?id=${attachment.id}">${attachment.upfileFileName}</a>
				<span onclick="deleteAttachment('${attachment.id}')" class="delete" title="删除附件"></span>
				</td>
			</tr>
			</c:if>
	<tr>
		<td>承接范围：</td>
		<td colspan="3"><textarea name="undertake" rows="3" cols="60">${undertake}</textarea></td>
	</tr>
	<tr>
		<td>备注：</td>
		<td colspan="3"><textarea name="remark" rows="3" cols="60">${remark}</textarea></td>
	</tr>
</table>
<div class="type-button"><input   type="submit"
	class="submit" value="保存" /> <input   type="button"
	value="关闭" class="reset" onclick="_cloBtn();" /></div>
</form>
</body>
</html>
